﻿namespace homework1

{

    internal class Program

    {

        static void Main(string[] args)

        {

            Console.Write("请输入一个正整数：");

            int n = int.Parse(Console.ReadLine());

            int temp = n;

            int k = 2;

            Console.Write($"{n} = ");

            while (k <= temp)

            {

                if (temp % k == 0)

                {

                    Console.Write(k);

                    temp /= k;

                    if (temp != 1)

                    {

                        Console.Write(" * ");

                    }

                }

                else

                {

                    k++;

                }

            }

        }

    }

}

​